﻿Public Class CL_PRUEBA
    Public Shared Sub Get_Prueba(ByRef Rp As DotNetResponse.SQLPersistence, ByVal Id_Prueba As String, ByVal usuario As String)
        Dim EXEC As New DotNetDal.SQLPersistence(False, "cnn", DotNetDal.SQLPersistence.Provider.SQLCLIENT)
        Rp.StoredProcedure = "SP_GET_PRUEBA_DISENNO"
        Rp.AddParametro(Id_Prueba)
        Rp.AddParametro(usuario)
        EXEC.ExecuteDataTable(Rp)
    End Sub

    Public Shared Function SavePrueba(ByRef rp As DotNetResponse.SQLPersistence, ByVal txt_id_prueba As String, ByVal txt_codigo_prueba As String, ByVal txt_titulo_prueba As String, ByVal txt_Observacion_prueba As String, ByVal cmb_puntos As String, ByVal cmb_ramo As String, ByVal cmb_curso As String, ByVal cmb_nivel As String, ByVal cmb_vigencia As String, ByVal usuario As String) As String
        Dim EXEC As New DotNetDal.SQLPersistence(True, "cnn", DotNetDal.SQLPersistence.Provider.SQLCLIENT)
        rp.AddParametro(Val(txt_id_prueba))
        rp.AddParametro(txt_codigo_prueba)
        rp.AddParametro(Trim(txt_titulo_prueba))
        rp.AddParametro(Trim(txt_Observacion_prueba))
        rp.AddParametro(cmb_puntos)
        rp.AddParametro(cmb_ramo)
        rp.AddParametro(cmb_curso)
        rp.AddParametro(cmb_nivel)
        rp.AddParametro(cmb_vigencia)
        rp.AddParametro(usuario)

        rp.StoredProcedure = "SP_CREAR_PRUEBA_DISENNO"
        EXEC.ExecuteScalar(rp)
        EXEC.Commit()

        If rp.TieneDatos Then
            Return True
        End If

        If Not rp.Errores Then
            Return True
        Else
            Return False
        End If

    End Function



End Class
